
function console(data)
	{
	$("#dialog").append(data);
	}

//$(document).ready(function(){
$(function(){
	// Dialog
	$('#dialog').dialog({
		autoOpen: true,
		width: 600
	});
	
	// Dialog Link
	$('#dialog_link').click(function(){
		$('#dialog').dialog('open');
		return false;
	});
	
	//hover states on the static widgets
	$('#dialog_link, ul#icons li').hover(
		function() { $(this).addClass('ui-state-hover'); }, 
		function() { $(this).removeClass('ui-state-hover'); }
	);
	
});

$.ui.dialog.prototype._oldinit = $.ui.dialog.prototype._init;
$.ui.dialog.prototype._init = function() {
	$(this.element).parent().css('position', 'fixed');
	$(this.element).dialog("option",{
									resizeStop: function(event,ui) {
										var position = [Math.floor(ui.position.left)-$(window).scrollLeft(),Math.floor(ui.position.top)-$(window).scrollTop()];
										$(event.target).parent().css('position', 'fixed');
										$(event.target).dialog('option','position',position);
										return true;
										}
									});
    this._oldinit();
};


